How do I use try and else in function in python

visit shbcf.ru